<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../jquery-easyui-1.5.2/themes/default/easyui.css">
		<link rel="stylesheet" type="text/css" href="../../jquery-easyui-1.5.2/themes/icon.css">
		<link rel="stylesheet" type="text/css" href="../../jquery-easyui-1.5.2/demo.css">
		<link rel="stylesheet" type="text/css" href="../../style/syExtIcon.css">

		<script type="text/javascript" src="../../jquery-easyui-1.5.2/jquery.min.js"></script>
		<script type="text/javascript" src="../../jquery-easyui-1.5.2/jquery.easyui.min.js"></script>
		<script type="text/javascript" src="../../js/syExtEasyUI.js"></script>
		<script type="text/javascript" src="../../js/syExtHighcharts.js"></script>
		<script type="text/javascript" src="../../js/syExtJavascript.js"></script>
		<script type="text/javascript" src="../../js/syExtJquery.js"></script>
		<script type="text/javascript">
			var submitNow = function($parentId,$dialog, $tree, $pjq) {
				if(!$('#form').form("validate")){
					return;
				}
				var url = '/carpark/addChildCarpark';
				var data=sy.serializeObject($('#form'));
				if(data.id==null){
					data.parentId=$parentId;
				}
				$.post(url,data , function(result) {
					if(result.success) {
						$pjq.messager.alert('提示', result.msg, 'info');
						$tree.tree('reload');
						$dialog.dialog('destroy');
					} else {
						$pjq.messager.alert('提示', result.msg, 'error');
					}
				}, 'json');
			}
			var loadForm=function(data){
				if(data==null){
					return;
				}
				$('form').form('load', {
						'id' : data.id,
						'parentId' : data.parentId,
						'code' : data.code,
						'name' : data.name,
						'tempCarIsIn' : data.tempCarIsIn,
						'isCharge' : data.isCharge,
					});
			}
			$(function(){
				if(parent.carparkData==null||parent.carparkData.attributes.id==null){
					return;
				}
				loadForm(parent.carparkData.attributes);
			});
		</script>
	</head>

	<body>
		<form id="form" method="post">
				<table class="table" style="width: 100%;">
					<tr style="display: none;">
						<th>id</th>
						<td><input name="id" value="" /></td>
					</tr>
					<tr style="display: none;">
						<th>parentId</th>
						<td><input name="parentId" value="" /></td>
					</tr>
					<tr>
						<th>停车场编码</th>
						<td><input name="code" value="" class="easyui-textbox" data-options="required:true" /></td>
					</tr>
					<tr>
						<th>停车场名称</th>
						<td><input name="name" value="" class="easyui-textbox" data-options="required:true" /></td>
					</tr>
					<tr>
						<th></th>
						<td><input type="checkbox" name="tempCarIsIn" value="true" />不允许临时车进入</td>
					</tr>
					<tr>
						<th></th>
						<td><input type="checkbox" name="isCharge" value="true" checked="true" />临时车收费</td>
					</tr>
				</table>
		</form>
	</body>

</html>